<?php


namespace App\Transformers\Product;


use App\Models\ProductAttrResult;
use League\Fractal\TransformerAbstract;

class ProductAttrResultTransformer extends TransformerAbstract
{

    public function transform(ProductAttrResult $data)
    {
        return [
            'id' => $data->id,
            'product_id' => $data->product_id ?? '',
            'result' => $data->result ?? '',
            'type' => $data->type ?? '',
            'type_text' => $data->typeTypeEnum[$data->type] ?? '',
        ];
    }



}
